import type { App, Directive } from 'vue'

import draggable from './modules/draggable'
import permissions from './modules/permissions'

const directivesList: { [key: string]: Directive } = {
  draggable,
  permissions,
}

const directives = {
  install(app: App<Element>) {
    Object.keys(directivesList).forEach(key => {
      app.directive(key, directivesList[key])
    })
  },
}

export default directives
